home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr22 / gnplt.zip / CONTROLS.DEM < prev    next >
Text File  |  1993-05-11  |  805b  |  32 lines

  1. #
  2. # $Id: controls.demo 3.38.2.6 1992/11/14 02:25:21 woo Exp $
  3. #
  4. # warning:  this demo is SLOW on PCs without math coprocessors!
  5. #
  6. # From _Automatic_Control_Systems_, fourth ed., figure 6-14
  7. # transient response of a second-order system to a unit step input function
  8. #
  9. damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
  10. per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
  11. c(t) = 1-damp(t)*per(t)
  12. #
  13. #    wn is natural undamped frequency
  14. #    s is damping factor
  15. #
  16. wn = 1.0
  17. set xrange [0:13]
  18. set samples 50
  19. set dummy t
  20. #
  21. # plot c(t) for several different damping factors s
  22. #
  23. plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
  24. pause -1 "Hit return to continue"
  25.  
  26. # undo what we have done
  27. set xrange [-10:10]
  28. set autoscale xy
  29. set samples 160
  30. set dummy x
  31.  
  32.